/*
 *  Copyright 2011 yura.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package org.opu.pc.ui.client.actions;

import java.awt.event.ActionEvent;

import javax.swing.JOptionPane;

import org.opu.pc.ui.client.i18n.AboutI18N;
import org.opu.pc.ui.util.ConfigPath;
import org.opu.pc.ui.util.ResourceHandle;

/**
 * 
 * @author yura
 */
public class About extends AbstractAction {
	
	private static final long serialVersionUID = -1366124870087890969L;
	
	/** My name */
	public static final String MNAME = "About";
	public static final String ICON = "aboutDialog.png";
	public static final int ETALON_W = 600;
	public static final int ETALON_H = 300;
	public static final int BORDER = 10;
	private AboutI18N i18N = new AboutI18N();

	@Override
	public String getName() {
		return MNAME;
	}

	@Override
	public void action(ActionEvent e) {

		JOptionPane.showMessageDialog(mainView.asFrame(), i18N.getVersion()
				+ ": "
				+ ResourceHandle.getApplicationVersionString()
				+ "\n"
				+ i18N.getName()
				+ ": "
				+ ResourceHandle.getApplicationName()
				+ "\n"
				+ i18N.getConfigsFolder()
				+ ": "
				+ ConfigPath.getInstance().getApplicationConfDir()
						.getAbsolutePath(),
				getDialogTitle(), 
				JOptionPane.INFORMATION_MESSAGE);
		
		onActionFinish();
	}
}
